<%--
  Created by IntelliJ IDEA.
  User: Administrator 就业问卷统计
  Date: 2016/10/13
  Time: 1:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%>
<html>
<head>
  <base href="<%=basePath%>">
  <meta charset="utf-8"/>
  <title></title>
    <link rel="stylesheet" type="text/css" href="easyui-1.4/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui-1.4/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="easyui-1.4/demo/demo.css">
    <script type="text/javascript" src="easyui-1.4/jquery.min.js"></script>
    <script type="text/javascript" src="easyui-1.4/jquery.easyui.min.js"></script>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title" id="index-page-title" style="font: normal 30px/0.8em '微软雅黑'">孜点教科</h3>
        <ul class="page-breadcrumb breadcrumb">
            <%--<li>
                <i class="fa fa-home"></i>
                首页
                <i class="fa fa-angle-right"></i>
            </li>--%>
            <li>
                <%--<a href="javascript:;">--%>
                问卷管理
                <%--</a>--%>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <%--<a href="javascript:;">--%>
                就业问卷统计
                <%--</a>--%>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div style="margin:20px 0;"></div>
<%--action="rest/EmploymentQuestionnaire/insertEmploymentStatistical"--%>
<div style="width:800px;margin: 0 auto;background: #fff;">
    <div class="easyui-panel" title="就业问卷统计" style="width:800px;">
    <div style="margin: 20px 42px;">
        <form id="ff" class="easyui-form"  method="post" data-options="novalidate:true"  enctype="multipart/form-data">
    <%--enctype="multipart/form-data"--%>
            <div style="display:inline-block;height:30px;line-height:30px;width:710px;margin-bottom: 10px;">
              就业问卷标题:&nbsp;<input class="easyui-validatebox textbox" name="questionnaireTitle"
              data-options="required:true,missingMessage:'不能为空！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;">
              &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;就业问卷URL:&nbsp;<input class="easyui-validatebox textbox" name="questionnaireURL"
              data-options="required:true,missingMessage:'不能为空！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;">
            </div>
    <div id="questionNum">

    <div style="display:inline-block;height:30px;width:710px;margin-bottom: 10px;letter-spacing:6px;">问题序号:<input class="easyui-numberbox" name="questionNum" value="请输入数字"
                     data-options="required:true,missingMessage:'请输入数字！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"></div>

    <div style="display:inline-block;height:30px;line-height:30px;width:710px;margin-bottom: 10px;letter-spacing:6px;">问题作用:<input class="easyui-validatebox textbox validatebox-text validatebox-invalid" name="questionState"
                     data-options="required:true,missingMessage:'不能为空！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"></div>

    <div style="display:inline-block;height:30px;line-height:30px;width:710px;margin-bottom: 10px;letter-spacing:6px;">问题描述:<input class="easyui-validatebox textbox validatebox-text validatebox-invalid" name="questionDescribe"
                     data-options="required:true,missingMessage:'不能为空！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"></div>

    <div style="display:inline-block;height:30px;line-height:30px;width:710px;margin-bottom: 10px;">选项统计结果:&nbsp;<input class="easyui-validatebox textbox validatebox-text validatebox-invalid" name="optionStatistical" placeholder="格式：描述1_统计!描述2_统计"  value=""
                 data-options="required:true,missingMessage:'不能为空！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;">&nbsp;&nbsp;注：感叹号与下划线都为英文状态</div>

    <div style="display:inline-block;height:20px;width:710px;margin-bottom: 10px;"><p style="display:inline-block;width:81px;">选择统计图片:&nbsp;</p><%--<input class="easyui-filebox" name="statisticalPhoto"  style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;">--%><input type='file' name='statisticalPhoto' style="display:inline-block;width:250px;"></div>

    <div style="display:inline-block;height:30px;width:710px;margin-bottom: 10px;">问题填写人数:&nbsp;<input class="easyui-numberbox" name="numberOfPeople" value="请输入数字"
                 data-options="required:true,missingMessage:'请输入数字！'" style="width:250px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"></div>

      <br/>
    </div>
<br/>
        <input type="button" value="添加问题" id="addQuestion" onclick="addQuestion()"/><br/><br/>
</form>
    </div>
    <div style="text-align:center; padding:5px;margin:10px auto 20px;">
  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:102px;height:30px;">确定</a>
  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:102px;height:30px;">取消</a>
</div>
</div>

</body>

<script>

  var num=0;
  var tableid="";
  var fxid="";


    $("#addQuestion").click(function () {
      num++;

        var questionNum="<div style='margin:8px 0 5px 0px;letter-spacing: 6px;'>问题序号:<input class='easyui-numberbox' name='questionNum' data-options='required:true' style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'></div>"+
                "<div style='margin-bottom: 5px;letter-spacing: 6px;'>问题作用:<input class='easyui-validatebox' name='questionState' data-options='required:true' style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'></br></div>"+
                "<div style='margin-bottom: 5px;letter-spacing: 6px;'>问题描述:<input class='easyui-validatebox ' name='questionDescribe' data-options='required:true' style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'></div>"+
                "<div style='margin-bottom: 5px;'>选项统计结果:&nbsp;<input class='easyui-validatebox' name='optionStatistical' value='''  data-options='required:true' placeholder='格式：描述1_统计!描述2_统计' style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'>&nbsp;&nbsp;注：感叹号与下划线都为英文状态</div>"+
                "<div style='margin-bottom: 5px;'>选择统计图片:&nbsp;<input class='easyui-filebox' name='statisticalPhoto'  style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'></div>"+
                "<div style='margin-bottom: 5px;'>问题填写人数:&nbsp;<input class='easyui-numberbox' name='numberOfPeople' data-options='required:true' style='width:250px;height:22px;line-height: 22px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;'></div><br/>";

      var questionNum1 =$("#questionNum").append(questionNum);

      $.parser.parse(questionNum1);

    });
//  EmploymentQuestionnaire/insertEmploymentStatistical

//  function submit(){
//      $('#ff').form('submit', {
////          url: 'rest/EmploymentQuestionnaire/insertEmploymentStatistical',
//          onSubmit: function () {
//              return $(this).form('enableValidation').form('validate');
//          }
//      })(http://localhost:8080/assets/plugins/jquery-1.10.2.min.js:4:4994),
//  }
//  var f =$("#ff");
  function submitForm() {
      $('#ff').form('submit',{
          url : 'rest/EmploymentQuestionnaire/insertEmploymentStatistical',
          onSubmit: function () {
              return $(this).form('enableValidation').form('validate');
          },
          success : function(data){
              var obj = JSON.parse(data)
              if(obj.code == 200){
                  $.messager.show({title:'操作提示',msg:obj.message+"请刷新显示",showType:'show',style: {
                      top:($(window).height()-200) * 0.5,
                      left:($(window).width() -250) * 0.5
                  }});
                  $('#test1').window('close');
              }else{
                  $.messager.show({title:'操作提示',msg:obj.message,showType:'show',style: {
                      top:($(window).height()-200) * 0.5,
                      left:($(window).width() -250) * 0.5
                  }});
              }
          }
      });
  }
  function clearForm() {
      $('#ff').form('clear');
  }



</script>

</html>
